//
//  SecondViewController.swift
//  fire1
//
//  Created by Max Chiodo on 9/26/14.
//  Copyright (c) 2014 SSW. All rights reserved.
//

import UIKit

class FirstViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        // Read data and react to changes
        var usersRef = Firebase(url:"https://ssw-ng1-1.firebaseio.com/users/")
        
        usersRef.observeEventType(.ChildAdded, withBlock: {
            snapshot in
            var x = (snapshot.value.objectForKey("username") as String)
            self.label1.text = x
        })
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @IBOutlet weak var label1: UILabel!
    @IBOutlet weak var label2: UILabel!
    @IBOutlet weak var label3: UILabel!

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
